<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<meta charset="UTF-8">
<head>
    <title>选择考试场次</title>
    <th:block th:include="fragment_header :: header">
    </th:block>
</head>
<body>
<div th:replace="fragment_menu :: navmenu"></div>
<div class="container mt-5">
    <h1 class="mb-4">选择考试场次</h1>
    <table class="table" style="background-color:#FFFFFF;">
        <thead>
        <tr>
            <th>ID</th>
            <th>考试名称</th>
            <th>时间限制</th>
            <th>总分</th>
            <th>操作</th>
        </tr>
        </thead>

        <tbody>
        <tr th:each="exam : ${availableExams}">
            <td th:text="${exam.id}"></td>
            <td th:text="${exam.name}"></td>
            <td th:text="${exam.timeLimit}"></td>
            <td th:text="${exam.totalScore}"></td>
            <td>
                <form th:action="@{/question/submit-exam}" method="post">
                    <input type="hidden" name="selectedExam" th:value="${exam.id}" />
                    <button type="submit" class="btn btn-primary">选择考试</button>
                </form>
            </td>
        </tr>
        </tbody>

    </table>
</div>
</body>
</html>
